import request from "@/utils/request";

// 获取分类列表
export const getCateList = () => request.get('/my/cate/list')

// 添加分类
export const addArticleCate = data => {
    return request.post('/my/cate/add',data)
}

// 修改文章分类
export const updateArticleCate = data => {
    return request.put('/my/cate/info',data)
}

// 删除文章分类
export const delArticleCate = id => {
    return request.delete('/my/cate/del',{
        params: {
            id
        }
    })
}

// 获取分类详情
export const getArticleCateInfo = id => {
    return request.get('/my/cate/info',{
        params: {
            id
        }
    })
}

// 添加文章
export const addArticle = data => {
    return request.post('/my/article/add',data)
}

// 获取文章列表
export const getArticleList = data => request.get('/my/article/list',{
    params: {
        ...data
    }
})

// 获取文章详情
export const getArticleDetail = id => {
    return request.get('/my/article/info',{
        params: {
            id
        }
    })
}

// 修改文章
export const updateArticleList = data => request.put('/my/article/info',data)

// 删除文章
export const delArticleList = id => request.delete('/my/article/info',{
    params: {
        id
    }
})